package com.sali.entity;

import lombok.Data;

import java.nio.charset.StandardCharsets;

/**
 * @description:
 * @author: sali
 * @date: 2025/2/22 下午10:40.
 * @version: 1.0
 */
@Data
public class NettyBean {

    /**
     * 信息标志 0xA 表示心跳包 0xB表示超时包 0xC 业务包
     */
    private byte flag;

    private int length;

    private String content;

    private byte[] datas;

    public NettyBean(byte flag, String content) {
        this.flag = flag;
        this.datas = content.getBytes(StandardCharsets.UTF_8);
        this.length = datas.length;
        this.content = content;
    }

}
